package com.thoughtworks.shoutbox.client.room;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;

public class RoomView extends Composite {
	private RoomListView roomListView;

	public RoomView(){
		FlowPanel rootPanel = new FlowPanel();
		roomListView = new RoomListView();
		RoomCreationView roomCreationView = new RoomCreationView() {
			@Override
			protected void onNewRoow() {
				roomListView.reloadRooms();
			}
		};
		rootPanel.add(roomListView);
		rootPanel.add(roomCreationView);
		initWidget(rootPanel);
		roomListView.reloadRooms();
	}

	public void setRoomListener(RoomEntranceListener roomEntranceListener) {
		roomListView.setRoomListener(roomEntranceListener);
	}

}
